<template>
  <div class="page-wrap"
       @click.alt="test()">
    <el-row>
      <div>
        <p>您按下的按钮是{{ key }}</p>
      </div>
    </el-row>
  </div>
</template>

<script>
export default {
  components: {

  },
  props: {

  },
  data () {
    return {
      key: ''
    }
  },
  computed: {

  },
  watch: {

  },
  created () {
    document.onkeydown = function (e) {
      console.log(e)
      const _key = window.event.keyCode

      if (_key === 13 && e.altKey) {
        alert('Enter 和alt 键被按下了')
      } else if (_key === 13) {
        alert('Enter键被按下了')
      }
    }
  },
  mounted () {

  },
  methods: {
    test () {
      alert(1234)
    }
  }
}
</script>

<style scoped lang="scss">
.page-wrap {
  padding: 10px;
}
</style>
